﻿@{

    var gen = Model;
}
//=============================================================
// 创建人:            @gen.UserInfo.Author
// 创建时间:          @gen.UserInfo.CreateTime
// 邮箱：             @gen.UserInfo.Email
//==============================================================
using @(gen.NameSpace).Common;
using @(gen.NameSpace).Domain.Entities;
using @(gen.NameSpace).Domain.Helper;

namespace @(gen.NameSpace).Domain.Services.Iml
{
    public class @(gen.TableName)ManagerService : I@(gen.TableName)ManagerService
    {
        public List<@(gen.TableName)> All(int index, int pageSize,string? key)
        {
            var query = FreeSqlHelper.DbContext.Queryable<@(gen.TableName)>
    ();
    if (!key.IsNullOrWhiteSpace())
    {
    //query = query.Where(p => p.XX.Contains(key) || p.XX.Contains(key));
    }
    var list = query.Where(p=>!p.IsDelete)
    .OrderByDescending(p => p.UpdateTime)
    .Page(index, pageSize)
    .ToList();
    return list;
    }

    public long Count(string? key)
    {
    var query = FreeSqlHelper.DbContext.Queryable<@(gen.TableName)>
        ();
        if (!key.IsNullOrWhiteSpace())
        {
        //query = query.Where(p => p.XX.Contains(key) || p.XX.Contains(key));
        }
        var count = query.Count();
        return count;
        }
        }
        }

